import { request } from '@utils/http'
import {
  IhospitalListParams,
  IhospitalListRes,
  IdicList,
} from './model/hospitalListTypes'
// 获取医院列表表格数据
export function reqGetHospitalList({
  page,
  limit,
  provinceCode,
  cityCode,
  districtCode,
  hosname,
  hoscode,
  hostype,
  status,
}: IhospitalListParams) {
  return request.get<any, IhospitalListRes>(
    `/admin/hosp/hospital/${page}/${limit}`,
    {
      params: {
        provinceCode,
        cityCode,
        districtCode,
        hosname,
        hoscode,
        hostype,
        status,
      },
    }
  )
}

// 获取省数据函数
export function reqGetProvince(dictCode: string) {
  return request.get<any, IdicList>(
    `/admin/cmn/dict/findByDictCode/${dictCode}`
  )
}

// 获取市,区,以及医院类型数据的函数
export function reqGetCityOrDistrictOrHostype(parentId: string) {
  return request.get<any, IdicList>(
    `/admin/cmn/dict/findByParentId/${parentId}`
  )
}
